package middle;

import java.util.Stack;
import middle.Solution_71.Status;
import util.PrintUtils;

public class Solution_96 {

    public int numTrees(int n) {
        int[] arrays = new int[n+1];
        arrays[0] = 1;
        for (int i = 1; i <= n; i++) {
            int count = 0;
            for (int j = 1; j <= i; j++) {
                count = count + arrays[j - 1] * arrays[i - j];
            }
            arrays[i] = count;
        }
        PrintUtils.arrayInt(arrays);
        return arrays[n];
    }

    public static void main(String[] args) {
        Solution_96 model = new Solution_96();
        System.out.print(model.numTrees(19));
    }
}
